package com.org.cloud.lg.fegin;
import com.org.cloud.lg.config.FeignClientConfig;
import com.org.cloud.lg.dto.UserDto;
import com.org.cloud.lg.fegin.fallback.UserServiceFallbackImpl;
import feign.hystrix.FallbackFactory;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.stereotype.Component;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;

import java.util.Set;

/**
 * @author lg
 */
@FeignClient( name = "system-web", configuration = {FeignClientConfig.class},fallback = UserServiceFallbackImpl.class)
public interface UserService {
    /**
     * 通过用户名查询用户、角色信息
     *
     * @param username 用户名
     * @return UserVo
     */
    @GetMapping("/user/findUserByUsername/{username}")
    UserDto findUserByUsername(@PathVariable("username") String username);

    @GetMapping("/user/selectPermsByUid/{userId}")
    Set<String> selectPermsByUid(String userId);

}
